/**
 * 
 */
package functii.elementare;

import Interpretor.Context;
import functii.Functie;
import operatori.Impartit;

public class Logaritm extends Functie {

	public String toString() {
		if (fStang == null)
			System.exit(1);
		return concatTermeni(fStang.toString());
	}

	public String concatTermeni(String aux1) {
		String aux;
		int nrP;
		nrP = aux1.charAt(0) == '(' ? 0 : 2;
		aux = "ln";
		if (nrP != 0)
			aux += "(";

		aux += aux1;

		if (nrP != 0)
			aux += ")";

		return aux;
	}

	public static String ConcatTermeni(String aux1) {
		String aux;
		int nrP;
		nrP = aux1.charAt(0) == '(' ? 0 : 2;
		aux = "ln";
		if (nrP != 0)
			aux += "(";

		aux += aux1;

		if (nrP != 0)
			aux += ")";

		return aux;
	}
	public void interpret(Context cont) {
		cont.actual(this);
	}
	/*
	public static double Calcul(double aux1) {
		return Math.log(aux1);
	}

	public double calcul() {
		if (fStang == null)
			System.exit(1);
		return Calcul(fStang.calcul());
	}

	public double calculDerivata() {
		return Impartit.Calcul(fStang.calculDerivata(), fStang.calcul());
	}

	public String derivare() {
		return Impartit.ConcatTermeni(fStang.derivare(), fStang.toString());
	}
*/
}
